package net.demo.dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;

import org.springframework.stereotype.Component;

import net.demo.dao.IUserDaoService;
import net.demo.domain.User;

@Component
public class UserDaoImpl  implements IUserDaoService {

	@PersistenceContext(unitName = "primaryPersistenceUnit")
	private EntityManager manager;

	@Override
	@Transactional()
	public User addUser(User user) {
		User u=manager.merge(user);
		return u;
	}

}
